package com.yootk.action;

import com.yootk.action.abs.AbstractAction;
import com.yootk.service.IMessageService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.SpringServletContainerInitializer;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.ContextLoaderListener;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.servlet.ModelAndView;

import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;

@Controller // 控制层注解
@RequestMapping("/pages/message/")
public class MessageAction extends AbstractAction {
    private static final Logger LOGGER = LoggerFactory.getLogger(MessageAction.class);
    @Autowired
    private IMessageService messageService; // 业务接口实例
    @GetMapping("echo") // 映射地址
    public ModelAndView echo(String msg) { // 负责跳转
        ModelAndView mav = new ModelAndView("/message/show");
        mav.addObject("echoMessage", "【ECHO】" + msg);
        return mav;
    }


}